package com.homwork.Collection_learn.Set;

import java.util.HashSet;
import java.util.Set;

public class HashSetSource {
    public static void main(String[] args) {
        HashSet hashSet = new HashSet();
        hashSet.add("java");
        /**
         *   源码解读
         *
         * 1.执行HashSet
         * public HashSet() {
         *         map = new HashMap<>();
         *     }
         *
         * 2.执行add
         * public boolean add(E e) {// e="java"
         *         return map.put(e, PRESENT)==null;
         *     }
         *
         * 3.执行put
         *   public V put(K key, V value) {
         *         return putVal(hash(key), key, value, false, true);
         *     }
         *
         * 4.
         *
         */
    }
}
